using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Kinlo.Entitys
{
    /// <summary>重码检测表</summary>
    [Serializable]
    [DataObject]
    [Description("重码检测表")]
    [BindTable("IsRepeatData", Description = "重码检测表", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class IsRepeatData
    {
        #region 属性
        private String _Barcode;
        /// <summary>条码</summary>
        [DisplayName("条码")]
        [Description("条码")]
        [DataObjectField(true, false, true, 50)]
        [BindColumn("Barcode", "条码", "")]
        public String Barcode { get => _Barcode; set { if (OnPropertyChanging("Barcode", value)) { _Barcode = value; OnPropertyChanged("Barcode"); } } }

        private DateTime _AcquisitionTime;
        /// <summary>数据获取时间</summary>
        [DisplayName("数据获取时间")]
        [Description("数据获取时间")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("Acquisition_Time", "数据获取时间", "")]
        public DateTime AcquisitionTime { get => _AcquisitionTime; set { if (OnPropertyChanging("AcquisitionTime", value)) { _AcquisitionTime = value; OnPropertyChanged("AcquisitionTime"); } } }

        private String _TrayCode;
        /// <summary>托盘码</summary>
        [DisplayName("托盘码")]
        [Description("托盘码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("TrayCode", "托盘码", "")]
        public String TrayCode { get => _TrayCode; set { if (OnPropertyChanging("TrayCode", value)) { _TrayCode = value; OnPropertyChanged("TrayCode"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "Barcode": return _Barcode;
                    case "AcquisitionTime": return _AcquisitionTime;
                    case "TrayCode": return _TrayCode;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "Barcode": _Barcode = Convert.ToString(value); break;
                    case "AcquisitionTime": _AcquisitionTime = value.ToDateTime(); break;
                    case "TrayCode": _TrayCode = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得重码检测表字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>条码</summary>
            public static readonly Field Barcode = FindByName("Barcode");

            /// <summary>数据获取时间</summary>
            public static readonly Field AcquisitionTime = FindByName("AcquisitionTime");

            /// <summary>托盘码</summary>
            public static readonly Field TrayCode = FindByName("TrayCode");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得重码检测表字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>条码</summary>
            public const String Barcode = "Barcode";

            /// <summary>数据获取时间</summary>
            public const String AcquisitionTime = "AcquisitionTime";

            /// <summary>托盘码</summary>
            public const String TrayCode = "TrayCode";
        }
        #endregion
    }
}